package com.xayy.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.mybatis.interceptor.FillingCreateTime;
import cn.kawins.mybatis.interceptor.InsertAutoFilling;
import cn.kawins.mybatis.interceptor.UpdateAutoFilling;
import cn.kawins.mybatis.util.SnowflakeId;
import cn.kawins.spring.mvc.validator.Group;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import lombok.*;

/**
 * 性能指标表(PerformanceIndicators)实体类
 *
 * @author zhangxa
 * @since 2023-08-15 16:42:22
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "health_xw.t_performance_indicators")
@EqualsAndHashCode(callSuper = true)
public class PerformanceIndicators extends BaseModel<Long> {

    @Id
    @ApiModelProperty(value = "主键")
    @KeySql(genId = SnowflakeId.class)
    @JsonSerialize(using = ToStringSerializer.class)
    @Column(name = "id")
    private Long id;
    /**
     * 节点id
     */
    @ApiModelProperty(value = "节点id")
    @Column(name = "node_id")
    @NotNull(groups = Group.Insert.class)
    private Long nodeId;
    /**
     * 指标名称
     */
    @ApiModelProperty(value = "指标名称")
    @Column(name = "metrics_name")
    @NotBlank(groups = Group.Insert.class)
    private String metricsName;
    /**
     * 指标代号
     */
    @ApiModelProperty(value = "指标代号")
    @Column(name = "metrics_code")
    @NotBlank(groups = Group.Insert.class)
    private String metricsCode;

    /**
     * 说明
     */
    @ApiModelProperty(value = "说明")
    @Column(name = "notes")
    private String notes;

    /**
     * 自定义参数
     */
    @ApiModelProperty(value = "自定义参数")
    @Column(name = "custom_param")
    @NotBlank(groups = Group.Insert.class)
    private String customParam;


    /**
     * y轴功能项图数据
     */
    @ApiModelProperty(value = "y轴性能项图数据")
    @Column(name = "data_info")
    private String dataInfo;

    /**
     * y轴功能项图时间
     */
    @ApiModelProperty(value = "x轴性能项图时间")
    @Column(name = "time_info")
    private Date timeInfo;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @InsertAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date createdTime;
    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @UpdateAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "最后更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY, example = "2010-01-01 00:00:00")
    private Date updatedTime;

}

